from flask import session
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager

from info import create_app, db

app = create_app('develop')
# 数据库迁移的配置
# 把应用交给flask-script管理
manager = Manager(app)
# 关联app和db
Migrate(app, db)
# manager对象生成迁移命令
manager.add_command('db', MigrateCommand)


@app.route('/')
def index():
    session['name'] = 'xiaoming'
    session['age'] = 18
    name = session.get('name')
    print(name)

    return 'index1111'


if __name__ == '__main__':
    manager.run()
